import { http } from 'utils'

export async function getProfileList() {
  try {
    const res = await http.get('my/list')
    if (res.code === 1) {
      const data = res.data.data
      return data
    }
    throw new Error(res.info)
  } catch (err) {
    throw new Error(err)
  }
}

export async function updateProfile(payload) {
  try {
    const res = await http.post('my/update', payload)
    if (res.code === 1) {
      return res
    }
    throw new Error(111)
  } catch (err) {
    throw new Error(err)
  }
}
